/**
 * 通知候选人
 */
import React from 'react';
import { withRouter } from 'umi';
import AuthComponent from '@/utils/auth/AuthComponent';
import copy from 'copy-to-clipboard';
import { message } from 'antd';
import { Icon } from '../../components';

function InterviewCopyOperate({ id, location, candidateLink = '', ...rest }) {
    const handleCopy = () => {
        copy(
            `已为您生成专属【应聘通知】链接，您可以点击链接，实时查看最新应聘进度。
        链接：${candidateLink}`
        );
        message.success('复制成功');
    };
    return (
        <AuthComponent code="office:recruitment:course:copyCandidateLink">
            <Icon title="复制应聘通知链接" type="fuzhitongzhi1" onClick={handleCopy} {...rest} />
        </AuthComponent>
    );
}
export default withRouter(InterviewCopyOperate);
